// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.randomizedWorld.randomizedDeadSurvivor;

import zombie.characters.IsoGameCharacter;
import zombie.iso.BuildingDef;
import zombie.iso.RoomDef;
import zombie.iso.objects.IsoDeadBody;

public final class RDSSuicidePact extends RandomizedDeadSurvivorBase {
    public RDSSuicidePact() {
        this.name = "Suicide Pact";
        this.setChance(7);
        this.setMinimumDays(60);
    }

    @Override
    public void randomizeDeadSurvivor(BuildingDef def) {
        RoomDef roomDef = this.getLivingRoomOrKitchen(def);
        IsoGameCharacter isoGameCharacter = RandomizedDeadSurvivorBase.createRandomZombieForCorpse(roomDef);
        if (isoGameCharacter != null) {
            isoGameCharacter.addVisualDamage("ZedDmg_HEAD_Bullet");
            IsoDeadBody isoDeadBody = RandomizedDeadSurvivorBase.createBodyFromZombie(isoGameCharacter);
            if (isoDeadBody != null) {
                this.addBloodSplat(isoDeadBody.getSquare(), 4);
                isoDeadBody.setPrimaryHandItem(this.addWeapon("Base.Pistol", true));
                isoGameCharacter = RandomizedDeadSurvivorBase.createRandomZombieForCorpse(roomDef);
                if (isoGameCharacter != null) {
                    isoGameCharacter.addVisualDamage("ZedDmg_HEAD_Bullet");
                    isoDeadBody = RandomizedDeadSurvivorBase.createBodyFromZombie(isoGameCharacter);
                    if (isoDeadBody != null) {
                        this.addBloodSplat(isoDeadBody.getSquare(), 4);
                    }
                }
            }
        }
    }
}
